<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2017 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>24</version>
    </parent>

    <artifactId>jboss-ejb-client-parent</artifactId>
    <version>4.0.44.Final</version>

    <name>JBoss EJB Client Parent</name>
    <description>Client library for EJB applications working against Wildfly - Parent</description>
    <packaging>pom</packaging>

    <modules>
        <module>javax</module>
        <module>jakarta</module>
    </modules>
    <scm>
        <connection>scm:git:git@github.com:wildfly/jboss-ejb-client.git</connection>
        <developerConnection>scm:git:git@github.com:wildfly/jboss-ejb-client.git</developerConnection>
        <url>https://github.com/wildfly/jboss-ejb-client</url>
    </scm>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <version.org.jboss.bridger>1.4.Final</version.org.jboss.bridger>
        <version.org.jboss.byteman>4.0.7</version.org.jboss.byteman>
        <version.org.jboss.invocation>1.7.0.Final</version.org.jboss.invocation>
        <version.org.jboss.jboss-transaction-spi>7.6.1.Final</version.org.jboss.jboss-transaction-spi>
        <version.org.jboss.logging.jboss-logging>3.4.0.Final</version.org.jboss.logging.jboss-logging>
        <!-- 2.1.x also work on JDK9-->
        <version.org.jboss.logging.jboss-logging-tools>2.1.0.Final</version.org.jboss.logging.jboss-logging-tools>
        <version.org.jboss.logmanager>2.1.10.Final</version.org.jboss.logmanager>
        <version.org.jboss.marshalling>2.0.6.Final</version.org.jboss.marshalling>
        <version.org.jboss.modules>1.6.0.Final</version.org.jboss.modules>
        <version.org.jboss.narayana>5.12.1.Final</version.org.jboss.narayana>
        <version.org.jboss.remoting>5.0.17.Final</version.org.jboss.remoting>
        <version.org.jboss.spec.javax.ejb>1.0.0.Final</version.org.jboss.spec.javax.ejb>
        <version.jakarta.ejb-api>4.0.0</version.jakarta.ejb-api>
        <version.org.jboss.spec.javax.transaction>1.0.1.Final</version.org.jboss.spec.javax.transaction>
        <version.jakarta-transaction-api>2.0.0</version.jakarta-transaction-api>
        <version.org.jboss.spec.javax.resource.jboss-connector-api_1.7_spec>2.0.0.Final</version.org.jboss.spec.javax.resource.jboss-connector-api_1.7_spec>
        <version.org.jboss.threads>2.3.3.Final</version.org.jboss.threads>
        <version.org.jboss.xnio>3.8.2.Final</version.org.jboss.xnio>
        <version.org.kohsuke.metainf-services>1.7</version.org.kohsuke.metainf-services>
        <version.org.wildfly.client-config>1.0.1.Final</version.org.wildfly.client-config>
        <version.org.wildfly.common>1.5.1.Final</version.org.wildfly.common>
        <version.org.wildfly.naming.client>1.0.14.Final</version.org.wildfly.naming.client>
        <version.org.wildfly.discovery>1.2.1.Final</version.org.wildfly.discovery>
        <version.org.wildfly.security.elytron>1.17.0.Final</version.org.wildfly.security.elytron>
        <version.org.wildfly.transaction-client>2.0.0.Final</version.org.wildfly.transaction-client>
        <version.org.wildfly.extras.batavia>1.0.10.Final</version.org.wildfly.extras.batavia>

        <test-group>org/jboss/ejb/client</test-group>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.wildfly.extras.batavia</groupId>
                    <artifactId>transformer-tools-mvn</artifactId>
                    <version>${version.org.wildfly.extras.batavia}</version>
                    <executions>
                        <execution>
                            <id>transform-sources</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>transform-sources</goal>
                            </goals>
                            <configuration>
                                <source-project>${jakarta.transformer.input.dir}</source-project>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.wildfly.extras.batavia</groupId>
                            <artifactId>transformer-impl-eclipse</artifactId>
                            <version>${version.org.wildfly.extras.batavia}</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <forkMode>always</forkMode>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <systemProperties>
                            <property>
                                <name>java.util.logging.manager</name>
                                <value>org.jboss.logmanager.LogManager</value>
                            </property>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jboss.bridger</groupId>
                    <artifactId>bridger</artifactId>
                    <version>${version.org.jboss.bridger}</version>
                    <executions>
                        <!-- run after "compile", runs bridger on main classes -->
                        <execution>
                            <id>weave</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>transform</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.spec.javax.ejb</groupId>
                <artifactId>jboss-ejb-api_3.2_spec</artifactId>
                <version>${version.org.jboss.spec.javax.ejb}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.ejb</groupId>
                <artifactId>jakarta.ejb-api</artifactId>
                <version>${version.jakarta.ejb-api}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.spec.javax.transaction</groupId>
                <artifactId>jboss-transaction-api_1.2_spec</artifactId>
                <version>${version.org.jboss.spec.javax.transaction}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.transaction</groupId>
                <artifactId>jakarta.transaction-api</artifactId>
                <version>${version.jakarta-transaction-api}</version>
            </dependency>

            <dependency>
                <groupId>org.wildfly.transaction</groupId>
                <artifactId>wildfly-transaction-client</artifactId>
                <version>${version.org.wildfly.transaction-client}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>*</artifactId>
                        <groupId>*</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.wildfly.transaction</groupId>
                <artifactId>wildfly-transaction-client-jakarta</artifactId>
                <version>${version.org.wildfly.transaction-client}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>*</artifactId>
                        <groupId>*</groupId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.jboss.invocation</groupId>
                <artifactId>jboss-invocation</artifactId>
                <version>${version.org.jboss.invocation}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.jboss.invocation</groupId>
                <artifactId>jboss-invocation-jakarta</artifactId>
                <version>${version.org.jboss.invocation}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <dependency>
                <groupId>org.jboss.marshalling</groupId>
                <artifactId>jboss-marshalling</artifactId>
                <version>${version.org.jboss.marshalling}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.modules</groupId>
                <artifactId>jboss-modules</artifactId>
                <version>${version.org.jboss.modules}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.jboss.marshalling</groupId>
                <artifactId>jboss-marshalling-river</artifactId>
                <version>${version.org.jboss.marshalling}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-api</artifactId>
                <version>${version.org.jboss.xnio}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-nio</artifactId>
                <version>${version.org.jboss.xnio}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.remoting</groupId>
                <artifactId>jboss-remoting</artifactId>
                <version>${version.org.jboss.remoting}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
                <version>${version.org.jboss.logging.jboss-logging}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-processor</artifactId>
                <version>${version.org.jboss.logging.jboss-logging-tools}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-annotations</artifactId>
                <version>${version.org.jboss.logging.jboss-logging-tools}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.kohsuke.metainf-services</groupId>
                <artifactId>metainf-services</artifactId>
                <version>${version.org.kohsuke.metainf-services}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.wildfly.client</groupId>
                <artifactId>wildfly-client-config</artifactId>
                <version>${version.org.wildfly.client-config}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.common</groupId>
                <artifactId>wildfly-common</artifactId>
                <version>${version.org.wildfly.common}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.discovery</groupId>
                <artifactId>wildfly-discovery-client</artifactId>
                <version>${version.org.wildfly.discovery}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-auth</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-auth-server</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-credential</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-client</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-security-manager</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-security-manager-action</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-permission</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-sasl</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-realm</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-sasl-localuser</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-http-sso</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-http-util</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.security</groupId>
                <artifactId>wildfly-elytron-util</artifactId>
                <version>${version.org.wildfly.security.elytron}</version>
            </dependency>

            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-naming-client</artifactId>
                <version>${version.org.wildfly.naming.client}</version>
            </dependency>
            <!-- JUnit -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.logmanager</groupId>
                <artifactId>jboss-logmanager</artifactId>
                <version>${version.org.jboss.logmanager}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.threads</groupId>
                <artifactId>jboss-threads</artifactId>
                <version>${version.org.jboss.threads}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.jboss.narayana.jta</groupId>
                <artifactId>narayana-jta</artifactId>
                <version>${version.org.jboss.narayana}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.narayana.jta</groupId>
                <artifactId>narayana-jta-jakarta</artifactId>
                <version>${version.org.jboss.narayana}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.jboss.narayana.jts</groupId>
                <artifactId>narayana-jts-integration</artifactId>
                <version>${version.org.jboss.narayana}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.resource</groupId>
                <artifactId>jboss-connector-api_1.7_spec</artifactId>
                <version>${version.org.jboss.spec.javax.resource.jboss-connector-api_1.7_spec}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.jboss</groupId>
                <artifactId>jboss-transaction-spi</artifactId>
                <version>${version.org.jboss.jboss-transaction-spi}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss</groupId>
                <artifactId>jboss-transaction-spi-jakarta</artifactId>
                <version>${version.org.jboss.jboss-transaction-spi}</version>
                <scope>test</scope>
            </dependency>
            <!-- ByteMan -->
            <dependency>
                <groupId>org.jboss.byteman</groupId>
                <artifactId>byteman</artifactId>
                <version>${version.org.jboss.byteman}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.byteman</groupId>
                <artifactId>byteman-bmunit</artifactId>
                <version>${version.org.jboss.byteman}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <artifactId>testng</artifactId>
                        <groupId>org.testng</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.byteman</groupId>
                <artifactId>byteman-install</artifactId>
                <version>${version.org.jboss.byteman}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>allTests</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <!-- Disable default-test execution. -->
                            <execution>
                                <id>default-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>none</phase>
                            </execution>
                            <!-- Regular (non-Byteman) tests -->
                            <execution>
                                <id>tests-all</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <runOrder>alphabetical</runOrder>
                                    <!-- Tests to execute. -->
                                    <includes>
                                        <include>${test-group}/**/*TestCase.java</include>
                                    </includes>
                                    <!-- Skip Byteman tests -->
                                    <excludes>
                                        <exclude>${test-group}/**/byteman/*TestCase.java</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                            <!-- Byteman tests -->
                            <execution>
                                <id>tests-byteman</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <argLine>-Dorg.jboss.byteman.verbose, -Djdk.attach.allowAttachSelf=true</argLine>
                                    <environmentVariables>
                                        <BYTEMAN_HOME/>
                                    </environmentVariables>
                                    <includes>
                                        <include>${test-group}/**/byteman/*TestCase.java</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-bootclasspath</id>
            <activation>
                <property>
                    <name>test-bootclasspath</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>java</executable>
                            <longClasspath>false</longClasspath>
                            <classpathScope>test</classpathScope>
                            <commandlineArgs>-Xbootclasspath/a:%classpath org.jboss.ejb.client.test.ManualTestRunner
                                "Boot ClassPath Testing"
                            </commandlineArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
